<!DOCTYPE html>
<html lang="en">

<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>实体关系标注平台v2.0</title>
  <!-- plugins:css -->
  <link rel="stylesheet" href="{{ url_for('static', filename='css/materialdesignicons.min.css') }}"/>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/vendor.bundle.base.css') }}"/>
  <!-- endinject -->
  <!-- plugin css for this page -->
  <!-- End plugin css for this page -->
  <!-- inject:css -->
  <link rel="stylesheet" href="{{ url_for('static', filename='css/style1.css') }}"/>
  <!-- endinject -->
  <link rel="shortcut icon" href="{{ url_for('static', filename='images/favicon.png') }}" />
</head>

<body>
  <div class="container-scroller">
    <div class="container-fluid page-body-wrapper full-page-wrapper">
      <div class="content-wrapper d-flex align-items-center auth" style="background: url(../static/images/cover/Login_bg.jpg) no-repeat;background-size:cover">
        <div class="row w-100">
          <div class="col-lg-4"style="margin-left: 36%;opacity: 0.8">
            <div class="auth-form-light text-left p-5">
              <div class="brand-logo">
                <h3>用户注册</h3>
              </div>
{#                邮箱：<input name="email" type="text" id="email"/><br/>#}
{#        密码：<input name="password" type="password"/><br/>#}
{#        确认密码：<input name="en_password" type="password"/><br/>#}
{#        邮箱验证码：<input name="code" type="text"/><input id="send" type="button" value="发送验证码"/><br/>#}
              <form class="pt-3" action="/register" method="post">
                <div class="form-group">
                  <input type="text" name="username" class="form-control form-control-lg" id="exampleInputEmail1" placeholder="用户名">
                </div>
                  <div class="form-group">
                  <input type="text" name="email" class="form-control form-control-lg" id="email" placeholder="邮箱">
                </div>
                <div class="form-group">
                  <input type="password" name="password" class="form-control form-control-lg" id="exampleInputPassword1" placeholder="密码">
                </div>
                <div class="form-group">
                  <input type="password" name="en_password" class="form-control form-control-lg" id="exampleInputPassword1" placeholder="确认密码">
                </div>
                <div class="form-group">
                  <input type="password" name="code" class="form-control form-control-lg" placeholder="邮箱验证码" style="width: 70%;display: inline-block;"> <input class="btn btn-danger auth-form-btn" id="send" type="button" value="验证码" style="float: right;width: 25%;padding-left: 7%"/>
                </div>
                  <p style="color: red">{{ inf }}</p>
                <div class="mt-3">
                  <button class="btn btn-block btn-gradient-primary btn-lg font-weight-medium auth-form-btn" type="submit">注册</button>
                </div>
                <div class="my-2 d-flex justify-content-between align-items-center">
                  <div class="form-check">
                  </div>
                     <a href="/login" class="auth-link text-black">已有账号?</a>
                </div>
              </form>
            </div>
          </div>
        </div>
      </div>
      <!-- content-wrapper ends -->
    </div>
    <!-- page-body-wrapper ends -->
  </div>
  <!-- container-scroller -->
  <!-- plugins:js -->
  <script src="{{ url_for('static', filename='js/vendor.bundle.base.js') }}"></script>
  <script src="{{ url_for('static', filename='js/vendor.bundle.addons.js') }}"></script>
  <!-- endinject -->
  <!-- inject:js -->
  <script src="{{ url_for('static', filename='js/off-canvas.js') }}"></script>
  <script src="{{ url_for('static', filename='js/misc.js') }}"></script>
  <!-- endinject -->
</body>
<script>
    $('#send').click(function () {
        if($('#email').val() != '') {
            $.ajax({
                url: '/send_code',
                type: 'POST',
                data: {'email': $('#email').val()},
                success: function (data) {
                    if(data == 'success'){
                        alert('验证码发送成功！')
                    }else{
                        alert('发送失败！')
                    }
                }

            })
        }else{
            alert('邮箱不能为空！')
        }
    })
</script>
</html>
